package com.ruoyi.oss.cloud;

import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.oss.service.IOssService;

public final class OSSFactory {
	
	private static IOssService ossService;
	
	static {
        OSSFactory.ossService = SpringUtils.getBean(IOssService.class);
    }
	
	public static AbstractCloudStorageService build(){
        //获取云存储配置信息
        CloudStorageConfig config = ossService.getValueObject(CloudStorageConfig.class);

        return new AliyunCloudStorageService(config);
    }

}
